﻿using System;

namespace AbpQrCodeTest
{
    using System.IO;

    using Abp;
    using Abp.Modules;
    using Abp.Reflection.Extensions;

    using AbpPlusPlus;
    using AbpPlusPlus.QrCode;

    class Program
    {
        static void Main(string[] args)
        {
            var abpBoot = AbpBootstrapper.Create<AbpQrCodeTestModule>();
            abpBoot.Initialize();

            IAbpQrCodeGenerator codeGenerator = abpBoot.IocManager.Resolve<IAbpQrCodeGenerator>();

            var bytes = codeGenerator.Generator("ddd");

            using (var file=File.Create("baidu.jpg"))
            {
                file.Write(bytes,0,bytes.Length);
            }
            
            Console.WriteLine("输入任意键返回...");
            Console.ReadKey(true);
        }
    }

    [DependsOn(typeof(AbpQrCodeModule))]
    public class AbpQrCodeTestModule : AbpModule
    {
        public override void Initialize()
        {
            this.IocManager.RegisterAssemblyByConvention(
                typeof(AbpQrCodeTestModule).GetAssembly());
        }
    }
}
